home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / PInterfaces / QD3DDrawContext.p < prev    next >
Encoding:
Text File  |  1998-08-17  |  12.2 KB  |  300 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        QD3DDrawContext.p
  3.  
  4.      Contains:    Draw context class types and routines                               
  5.  
  6.      Version:    Technology:    Quickdraw 3D 1.5.4
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1995-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. }
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT QD3DDrawContext;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __QD3DDRAWCONTEXT__}
  27. {$SETC __QD3DDRAWCONTEXT__ := 1}
  28.  
  29. {$I+}
  30. {$SETC QD3DDrawContextIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33. {$IFC UNDEFINED __QD3D__}
  34. {$I QD3D.p}
  35. {$ENDC}
  36.  
  37. {$IFC TARGET_OS_MAC }
  38. {$IFC UNDEFINED __QUICKDRAW__}
  39. {$I Quickdraw.p}
  40. {$ENDC}
  41. {$IFC UNDEFINED __FIXMATH__}
  42. {$I FixMath.p}
  43. {$ENDC}
  44. {$IFC UNDEFINED __GXTYPES__}
  45. {$I GXTypes.p}
  46. {$ENDC}
  47. {$ENDC}  {TARGET_OS_MAC}
  48.  
  49.  
  50. {$PUSH}
  51. {$ALIGN POWER}
  52. {$LibExport+}
  53.  
  54. {*****************************************************************************
  55.  **                                                                             **
  56.  **                            DrawContext Data Structures                         **
  57.  **                                                                             **
  58.  ****************************************************************************}
  59.  
  60. TYPE
  61.     TQ3DrawContextClearImageMethod  = LONGINT;
  62. CONST
  63.     kQ3ClearMethodNone            = {TQ3DrawContextClearImageMethod}0;
  64.     kQ3ClearMethodWithColor        = {TQ3DrawContextClearImageMethod}1;
  65.  
  66.  
  67.  
  68. TYPE
  69.     TQ3DrawContextDataPtr = ^TQ3DrawContextData;
  70.     TQ3DrawContextData = RECORD
  71.         clearImageMethod:        TQ3DrawContextClearImageMethod;
  72.         clearImageColor:        TQ3ColorARGB;
  73.         pane:                    TQ3Area;
  74.         paneState:                TQ3Boolean;
  75.         mask:                    TQ3Bitmap;
  76.         maskState:                TQ3Boolean;
  77.         doubleBufferState:        TQ3Boolean;
  78.     END;
  79.  
  80. {*****************************************************************************
  81.  **                                                                             **
  82.  **                                DrawContext Routines                         **
  83.  **                                                                             **
  84.  ****************************************************************************}
  85. FUNCTION Q3DrawContext_GetType(drawContext: TQ3DrawContextObject): TQ3ObjectType; C;
  86. FUNCTION Q3DrawContext_SetData(context: TQ3DrawContextObject; {CONST}VAR contextData: TQ3DrawContextData): TQ3Status; C;
  87. FUNCTION Q3DrawContext_GetData(context: TQ3DrawContextObject; VAR contextData: TQ3DrawContextData): TQ3Status; C;
  88. FUNCTION Q3DrawContext_SetClearImageColor(context: TQ3DrawContextObject; {CONST}VAR color: TQ3ColorARGB): TQ3Status; C;
  89. FUNCTION Q3DrawContext_GetClearImageColor(context: TQ3DrawContextObject; VAR color: TQ3ColorARGB): TQ3Status; C;
  90. FUNCTION Q3DrawContext_SetPane(context: TQ3DrawContextObject; {CONST}VAR pane: TQ3Area): TQ3Status; C;
  91. FUNCTION Q3DrawContext_GetPane(context: TQ3DrawContextObject; VAR pane: TQ3Area): TQ3Status; C;
  92. FUNCTION Q3DrawContext_SetPaneState(context: TQ3DrawContextObject; state: TQ3Boolean): TQ3Status; C;
  93. FUNCTION Q3DrawContext_GetPaneState(context: TQ3DrawContextObject; VAR state: TQ3Boolean): TQ3Status; C;
  94. FUNCTION Q3DrawContext_SetClearImageMethod(context: TQ3DrawContextObject; method: TQ3DrawContextClearImageMethod): TQ3Status; C;
  95. FUNCTION Q3DrawContext_GetClearImageMethod(context: TQ3DrawContextObject; VAR method: TQ3DrawContextClearImageMethod): TQ3Status; C;
  96. FUNCTION Q3DrawContext_SetMask(context: TQ3DrawContextObject; {CONST}VAR mask: TQ3Bitmap): TQ3Status; C;
  97. FUNCTION Q3DrawContext_GetMask(context: TQ3DrawContextObject; VAR mask: TQ3Bitmap): TQ3Status; C;
  98. FUNCTION Q3DrawContext_SetMaskState(context: TQ3DrawContextObject; state: TQ3Boolean): TQ3Status; C;
  99. FUNCTION Q3DrawContext_GetMaskState(context: TQ3DrawContextObject; VAR state: TQ3Boolean): TQ3Status; C;
  100. FUNCTION Q3DrawContext_SetDoubleBufferState(context: TQ3DrawContextObject; state: TQ3Boolean): TQ3Status; C;
  101. FUNCTION Q3DrawContext_GetDoubleBufferState(context: TQ3DrawContextObject; VAR state: TQ3Boolean): TQ3Status; C;
  102.  
  103. {*****************************************************************************
  104.  **                                                                             **
  105.  **                            Pixmap Data Structure                             **
  106.  **                                                                             **
  107.  ****************************************************************************}
  108.  
  109. TYPE
  110.     TQ3PixmapDrawContextDataPtr = ^TQ3PixmapDrawContextData;
  111.     TQ3PixmapDrawContextData = RECORD
  112.         drawContextData:        TQ3DrawContextData;
  113.         pixmap:                    TQ3Pixmap;
  114.     END;
  115.  
  116. {*****************************************************************************
  117.  **                                                                             **
  118.  **                        Pixmap DrawContext Routines                             **
  119.  **                                                                             **
  120.  ****************************************************************************}
  121. FUNCTION Q3PixmapDrawContext_New({CONST}VAR contextData: TQ3PixmapDrawContextData): TQ3DrawContextObject; C;
  122. FUNCTION Q3PixmapDrawContext_SetPixmap(drawContext: TQ3DrawContextObject; {CONST}VAR pixmap: TQ3Pixmap): TQ3Status; C;
  123. FUNCTION Q3PixmapDrawContext_GetPixmap(drawContext: TQ3DrawContextObject; VAR pixmap: TQ3Pixmap): TQ3Status; C;
  124.  
  125.  
  126. {$IFC TARGET_OS_MAC }
  127. {*****************************************************************************
  128.  **                                                                             **
  129.  **                        Macintosh DrawContext Data Structures                 **
  130.  **                                                                             **
  131.  ****************************************************************************}
  132.  
  133. TYPE
  134.     TQ3MacDrawContext2DLibrary     = LONGINT;
  135. CONST
  136.     kQ3Mac2DLibraryNone            = {TQ3MacDrawContext2DLibrary}0;
  137.     kQ3Mac2DLibraryQuickDraw    = {TQ3MacDrawContext2DLibrary}1;
  138.     kQ3Mac2DLibraryQuickDrawGX    = {TQ3MacDrawContext2DLibrary}2;
  139.  
  140.  
  141.  
  142. TYPE
  143.     TQ3MacDrawContextDataPtr = ^TQ3MacDrawContextData;
  144.     TQ3MacDrawContextData = RECORD
  145.         drawContextData:        TQ3DrawContextData;
  146.         window:                    CWindowPtr;
  147.         library:                TQ3MacDrawContext2DLibrary;
  148.         viewPort:                gxViewPort;
  149.         grafPort:                CGrafPtr;
  150.     END;
  151.  
  152. {*****************************************************************************
  153.  **                                                                             **
  154.  **                        Macintosh DrawContext Routines                         **
  155.  **                                                                             **
  156.  ****************************************************************************}
  157. FUNCTION Q3MacDrawContext_New({CONST}VAR drawContextData: TQ3MacDrawContextData): TQ3DrawContextObject; C;
  158. FUNCTION Q3MacDrawContext_SetWindow(drawContext: TQ3DrawContextObject; window: CWindowPtr): TQ3Status; C;
  159. FUNCTION Q3MacDrawContext_GetWindow(drawContext: TQ3DrawContextObject; VAR window: CWindowPtr): TQ3Status; C;
  160. FUNCTION Q3MacDrawContext_SetGXViewPort(drawContext: TQ3DrawContextObject; viewPort: gxViewPort): TQ3Status; C;
  161. FUNCTION Q3MacDrawContext_GetGXViewPort(drawContext: TQ3DrawContextObject; VAR viewPort: gxViewPort): TQ3Status; C;
  162. FUNCTION Q3MacDrawContext_SetGrafPort(drawContext: TQ3DrawContextObject; grafPort: CGrafPtr): TQ3Status; C;
  163. FUNCTION Q3MacDrawContext_GetGrafPort(drawContext: TQ3DrawContextObject; VAR grafPort: CGrafPtr): TQ3Status; C;
  164. FUNCTION Q3MacDrawContext_Set2DLibrary(drawContext: TQ3DrawContextObject; library: TQ3MacDrawContext2DLibrary): TQ3Status; C;
  165. FUNCTION Q3MacDrawContext_Get2DLibrary(drawContext: TQ3DrawContextObject; VAR library: TQ3MacDrawContext2DLibrary): TQ3Status; C;
  166. {$ENDC}  {TARGET_OS_MAC}
  167.  
  168. {$IFC TARGET_OS_UNIX }
  169. {*****************************************************************************
  170.  **                                                                             **
  171.  **                        X/Windows DrawContext Data Structures                 **
  172.  **                                                                             **
  173.  ****************************************************************************}
  174.  
  175. TYPE
  176.     TQ3XBufferObject = ^LONGINT;
  177.     TQ3XColormapDataPtr = ^TQ3XColormapData;
  178.     TQ3XColormapData = RECORD
  179.         baseEntry:                LONGINT;
  180.         maxRed:                    LONGINT;
  181.         maxGreen:                LONGINT;
  182.         maxBlue:                LONGINT;
  183.         multRed:                LONGINT;
  184.         multGreen:                LONGINT;
  185.         multBlue:                LONGINT;
  186.     END;
  187.  
  188.     TQ3XDrawContextDataPtr = ^TQ3XDrawContextData;
  189.     TQ3XDrawContextData = RECORD
  190.         contextData:            TQ3DrawContextData;
  191.         display:                DisplayPtr;
  192.         drawable:                Drawable;
  193.         visual:                    VisualPtr;
  194.         cmap:                    Colormap;
  195.         colorMapData:            TQ3XColormapDataPtr;
  196.     END;
  197.  
  198. {*****************************************************************************
  199.  **                                                                             **
  200.  **                        X/Windows DrawContext Routines                         **
  201.  **                                                                             **
  202.  ****************************************************************************}
  203. {$IFC NOT UNDEFINED XDC_OLD }
  204. FUNCTION Q3XDrawContext_New: TQ3DrawContextObject; C;
  205. PROCEDURE Q3XDrawContext_Set(drawContext: TQ3DrawContextObject; flag: UInt32; data: UNIV Ptr); C;
  206. PROCEDURE Q3XDrawContext_Get(drawContext: TQ3DrawContextObject; flag: UInt32; data: UNIV Ptr); C;
  207. {$ENDC}
  208. FUNCTION Q3XBuffers_New(VAR dpy: Display; numBuffers: UInt32; window: Window): TQ3XBufferObject; C;
  209. PROCEDURE Q3XBuffers_Swap(VAR dpy: Display; buffers: TQ3XBufferObject); C;
  210. FUNCTION Q3X_GetVisualInfo(VAR dpy: Display; VAR screen: Screen): XVisualInfoPtr; C;
  211.  
  212. FUNCTION Q3XDrawContext_New({CONST}VAR xContextData: TQ3XDrawContextData): TQ3DrawContextObject; C;
  213. FUNCTION Q3XDrawContext_SetDisplay(drawContext: TQ3DrawContextObject; {CONST}VAR display: Display): TQ3Status; C;
  214. FUNCTION Q3XDrawContext_GetDisplay(drawContext: TQ3DrawContextObject; VAR display: DisplayPtr): TQ3Status; C;
  215. FUNCTION Q3XDrawContext_SetDrawable(drawContext: TQ3DrawContextObject; drawable: Drawable): TQ3Status; C;
  216. FUNCTION Q3XDrawContext_GetDrawable(drawContext: TQ3DrawContextObject; VAR drawable: Drawable): TQ3Status; C;
  217. FUNCTION Q3XDrawContext_SetVisual(drawContext: TQ3DrawContextObject; {CONST}VAR visual: Visual): TQ3Status; C;
  218. FUNCTION Q3XDrawContext_GetVisual(drawContext: TQ3DrawContextObject; VAR visual: VisualPtr): TQ3Status; C;
  219. FUNCTION Q3XDrawContext_SetColormap(drawContext: TQ3DrawContextObject; colormap: Colormap): TQ3Status; C;
  220. FUNCTION Q3XDrawContext_GetColormap(drawContext: TQ3DrawContextObject; VAR colormap: Colormap): TQ3Status; C;
  221. FUNCTION Q3XDrawContext_SetColormapData(drawContext: TQ3DrawContextObject; {CONST}VAR colormapData: TQ3XColormapData): TQ3Status; C;
  222. FUNCTION Q3XDrawContext_GetColormapData(drawContext: TQ3DrawContextObject; VAR colormapData: TQ3XColormapData): TQ3Status; C;
  223. {$ENDC}  {TARGET_OS_UNIX}
  224.  
  225. {$IFC TARGET_OS_WIN32 }
  226. {*****************************************************************************
  227.  **                                                                             **
  228.  **                         Win32 DrawContext Data Structures                      **
  229.  **                                                                             **
  230.  ****************************************************************************}
  231.  
  232. TYPE
  233.     TQ3Win32DCDrawContextDataPtr = ^TQ3Win32DCDrawContextData;
  234.     TQ3Win32DCDrawContextData = RECORD
  235.         drawContextData:        TQ3DrawContextData;
  236.         _hdc:                    HDC;
  237.     END;
  238.  
  239. {$IFC UNDEFINED QD3D_NO_DIRECTDRAW }
  240.     TQ3DirectDrawObjectSelector  = LONGINT;
  241. CONST
  242.     kQ3DirectDrawObject            = {TQ3DirectDrawObjectSelector}1;
  243.     kQ3DirectDrawObject2        = {TQ3DirectDrawObjectSelector}2;
  244.  
  245.  
  246. TYPE
  247.     TQ3DirectDrawSurfaceSelector  = LONGINT;
  248. CONST
  249.     kQ3DirectDrawSurface        = {TQ3DirectDrawSurfaceSelector}1;
  250.     kQ3DirectDrawSurface2        = {TQ3DirectDrawSurfaceSelector}2;
  251.  
  252.  
  253. TYPE
  254.     TQ3DDSurfaceDescriptorPtr = ^TQ3DDSurfaceDescriptor;
  255.     TQ3DDSurfaceDescriptor = RECORD
  256.         objectSelector:            TQ3DirectDrawObjectSelector;
  257.         filler:                    ARRAY [0..3] OF LONGINT;
  258.     END;
  259.  
  260.     TQ3DDSurfaceDrawContextDataPtr = ^TQ3DDSurfaceDrawContextData;
  261.     TQ3DDSurfaceDrawContextData = RECORD
  262.         drawContextData:        TQ3DrawContextData;
  263.         ddSurfaceDescriptor:    TQ3DDSurfaceDescriptor;
  264.     END;
  265.  
  266. {$ENDC}
  267. {*****************************************************************************
  268.  **                                                                             **
  269.  **                            Win32DC DrawContext Routines                     **
  270.  **                                                                             **
  271.  ****************************************************************************}
  272. FUNCTION Q3Win32DCDrawContext_New({CONST}VAR drawContextData: TQ3Win32DCDrawContextData): TQ3DrawContextObject; C;
  273. FUNCTION Q3Win32DCDrawContext_SetDC(drawContext: TQ3DrawContextObject; newHDC: HDC): TQ3Status; C;
  274. FUNCTION Q3Win32DCDrawContext_GetDC(drawContext: TQ3DrawContextObject; VAR curHDC: HDC): TQ3Status; C;
  275. {*****************************************************************************
  276.  **                                                                             **
  277.  **                            DDSurface DrawContext Routines                     **
  278.  **                                                                             **
  279.  ****************************************************************************}
  280. {$IFC UNDEFINED QD3D_NO_DIRECTDRAW }
  281. FUNCTION Q3DDSurfaceDrawContext_New({CONST}VAR drawContextData: TQ3DDSurfaceDrawContextData): TQ3DrawContextObject; C;
  282. FUNCTION Q3DDSurfaceDrawContext_SetDirectDrawSurface(drawContext: TQ3DrawContextObject; {CONST}VAR ddSurfaceDescriptor: TQ3DDSurfaceDescriptor): TQ3Status; C;
  283. FUNCTION Q3DDSurfaceDrawContext_GetDirectDrawSurface(drawContext: TQ3DrawContextObject; VAR ddSurfaceDescriptor: TQ3DDSurfaceDescriptor): TQ3Status; C;
  284. {$ENDC}
  285. {$ENDC}  {TARGET_OS_WIN32}
  286.  
  287.  
  288.  
  289.  
  290. {$ALIGN RESET}
  291. {$POP}
  292.  
  293. {$SETC UsingIncludes := QD3DDrawContextIncludes}
  294.  
  295. {$ENDC} {__QD3DDRAWCONTEXT__}
  296.  
  297. {$IFC NOT UsingIncludes}
  298.  END.
  299. {$ENDC}
  300.